<!-- News List -->

<?php foreach ($get_news as $key => $get_new) { ?>
<article class="featured-news <?php if($key==0) echo 'ocean'; else if($key==1) echo 'green'; else if($key==2) echo 'orange'; else if($key==3) echo 'yellow'; ?>">
    <h2 class="head-title">News</h2>
    <div class="img-wrap">
        <img src="<?php echo base_url() . $get_new->url_gambar_news; ?>">
    </div>
    <div class="news-content">
        <header>
            <h1 class="title"><a href="<?php echo base_url(); ?>modul/news/view/<?php echo $get_new->id_news; ?>"><?php echo $get_new->judul_news; ?></a></h1>
        </header>
        <p><?php echo character_limiter($get_new->content_news, 250); ?></p>
        <span class="meta"><time class="date"><?php echo $get_new->date_update; ?></time></span>
    </div>
</article>
<?php } ?>

<!-- [end] News List -->

<!-- Pagination -->
<div class="pagination row">
    <div class="span-1">
         <?php
            $npp = $posisi-2;

            if($posisi==1) echo '<a class="prev disabled">Prev</a>';
            else{
                if($npp==0) echo anchor($base_url,'Prev', 'class="prev"');
                else echo anchor($base_url . '/' . $npp,'Prev', 'class="prev"');
            }
        ?>
    </div>
    <div class="span-2">
        <?php
        for($i=1;$i<=$total_page;$i++){
            $np = $i-1;
            if($i==1){
                if($i==$posisi) echo anchor($base_url,$i,'class="active"');
                else echo anchor($base_url,$i);
            } else if ($i==$posisi){
                echo anchor($base_url . '/' . $np,$i,'class="active"');
            } else {
                echo anchor($base_url . '/' . $np,$i);
            }
        }
        ?>
    </div>
    <div class="span-1">
        <?php
            if($posisi==$total_page) echo '<a class="next disabled">Next</a>';
            else echo anchor($base_url . '/' . $posisi,'Next', 'class="next"');
        ?>
    </div>
</div>
<!-- [end] Pagination -->  